using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace MMYY.DALFactory
{
    public class DataAccess
    {
        private static readonly string dbType = "MMYY." + System.Configuration.ConfigurationManager.AppSettings["DbType"];        
        public static MMYY.IDAL.IType CreateType()
        {
            try
            {
                return (IDAL.IType)Assembly.Load(dbType + "DAL").CreateInstance(dbType + "DAL.Type");
            }
            catch
            {
                return null;
            }
        }
        public static MMYY.IDAL.IData CreateData()
        {
            try
            {
                return (IDAL.IData)Assembly.Load(dbType + "DAL").CreateInstance(dbType + "DAL.Data");
            }
            catch
            {
                return null;
            }
        }
    }
}
